<!DOCTYPE html>
<html>
<head>
	<title>父子组件</title>
	<script type="text/javascript" src="../js/vue.js"></script>
</head>
<body>
<!--
	构造 Vue 实例时传入的各种选项大多数都可以在组件里使用。只有一个例外：data 必须是函数

	例：data:function(){}
-->
<div id="demo">
  <panda></panda>
</div>
<script type="text/javascript">
	var city = {
		template:`<div style="color:green">SiChuan of China</div>`,
	}
	var panda = {
		template:`
				<div>
					<p style="color:red">Panda from China</p>
					<city></city>
				 </div>`,
		components:{"city":city},
	}
	var vm = new Vue({
		el:"#demo",
		components:{"panda":panda},
	})
</script>
</body>
</html>